package com.chaosj.skill.discovery.registry

import com.chaosj.config.seata.Configuration
import com.chaosj.config.seata.ConfigurationFactory

/**
 * @Description:
 * @author: caoyangjie
 * @date: 2019年12月2019/12/23日 17:02
 * @Copyright: © 赢时胜
 */
interface IRegistryService<T> {

    /**
     * The constant PREFIX_SERVICE_MAPPING.
     */
    String PREFIX_SERVICE_MAPPING = "vgroup_mapping."
    /**
     * The constant PREFIX_SERVICE_ROOT.
     */
    String PREFIX_SERVICE_ROOT = "service"
    /**
     * The constant CONFIG_SPLIT_CHAR.
     */
    String CONFIG_SPLIT_CHAR = "."

    void register(InetSocketAddress address)

    void unregister(InetSocketAddress address)

    void subscribe(String cluster,T listener)

    void unsubscribe(String cluster,T listener)

    List<InetSocketAddress> lookup(String key)

    void close()

}